package com.itboye.sunsun.person.ui;

import java.util.Locale;

import android.annotation.SuppressLint;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.itboye.sunsunhome.R;
import com.itboye.sunsun.support.BaseActivity;

public class LanguageActivity extends BaseActivity {
	RelativeLayout relauyoutEnglish, relauyoutChina;
	private Configuration config;
	private DisplayMetrics dm;
	private Resources resources;
	private ImageView imgchina,imgEnglish;
	@Override
	@SuppressLint("InlinedApi")
	protected void onCreate(final Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		setContentView(R.layout.activity_language);
		resources = getResources();// 获得res资源对象
		config = resources.getConfiguration();// 获得设置对象
		dm = resources.getDisplayMetrics();
		
		findViewById(R.id.relauyoutChina).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				imgEnglish.setVisibility(View.GONE);
				imgchina.setVisibility(View.VISIBLE);
				imgchina.setBackground(getResources().getDrawable(R.drawable.stting_language));
				switchLanguage("en");
//				onCreate(arg0);
			}
		});
		findViewById(R.id.relauyoutEnglish).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				imgEnglish.setVisibility(View.VISIBLE);
				imgchina.setVisibility(View.GONE);
				imgEnglish.setBackground(getResources().getDrawable(R.drawable.stting_language));
				switchLanguage("zh");
			}
		});
		setStatusBarColor(R.color.home_blue);
	}


}
